package com.jimo.app;

import static android.Manifest.permission.REQUEST_INSTALL_PACKAGES;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.jimo.app.databinding.ActivityMainBinding;

public class MainActivity extends AppCompatActivity {
    private @NonNull ActivityMainBinding bind;
    @RequiresApi(api = Build.VERSION_CODES.TIRAMISU)
    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        bind=ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(bind.getRoot());
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        requestPermissions(new String[]{REQUEST_INSTALL_PACKAGES},0);
        bind.connect.setOnClickListener(v -> startActivity(new Intent(MainActivity.this,ConnectActivity.class)));
        bind.inject.setOnClickListener(v -> startActivity(new Intent(MainActivity.this,InjectActivity.class)));
    }
}


